cb4b8cd71e090b78eaedf805c0a977deabe83515,gantt-addon/src/main/java/org/tltv/gantt/client/GanttWidget.java,GanttWidget,addStep,#Widget#,445
Before Change
// bar height should be defined in css
int height = getElementHeightWithMargin(bar);
bar.getStyle().setTop(contentHeight, Unit.PX);
contentHeight += height;
registerBarEventListener(bar);
After Change
// bar height should be defined in css
int height = getElementHeightWithMargin(bar);
if ((stepIndex + 1) < (getChildren().size() - extraContentElements
.size())) {
// not the first step, update contentHeight by the previous step
int prevIndex = extraContentElements.size() + stepIndex;
int thisStepWidgetIndex = prevIndex + 1;
Widget w = getWidget(prevIndex);
if (w instanceof StepWidget) {
double top = parseSize(w.getElement().getStyle().getTop(), "px");
top += getElementHeightWithMargin(w.getElement());
bar.getStyle().setTop(top, Unit.PX);
updateTopForAllStepsBelow(thisStepWidgetIndex, height);
}
} else {
bar.getStyle().setTop(contentHeight, Unit.PX);
}
contentHeight += height;